var HTML = "";
var space = "";
var blank = "  ";
function getSubject() {
	var xmlDoc;
	if (window.ActiveXObject) {
		// 获得操作的xml文件的对象
		xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
		xmlDoc.async = false;
		xmlDoc.load("http://192.168.8.88:8088/conf");
		if (xmlDoc == null) {
			alert('您的浏览器不支持xml文件读取,于是本页面禁止您的操作,推荐使用IE5.0以上可以解决此问题!');
			window.location.href = '/Index.aspx';
			return;
		}
	}
	// 解析xml文件，判断是否出错
	if (xmlDoc.parseError.errorCode != 0) {
		alert(xmlDoc.parseError.reason);
		return;
	}
	// 获得根接点
	var nodes = xmlDoc.documentElement.childNodes;
	// 得到根接点下共有子接点个数，并循环
	for (var i = 0; i < nodes.length; i++) {
		// 如果接点名为 property
		if (nodes(i).nodeName == "property") {
			readproperty(nodes(i));
		}
	}
	// 删除对象
	delete (xmlDoc);
	// 显示HTML
	window.show.innerHTML = HTML;
	return;
}
// 读Tree节点
function readproperty(cI) {
	var nodes = cI.childNodes;
	var maperedHTML = space;
	var maperedHTML = space;
	HTML += "<div>\n";
	// 如果该节点的连接属性不为空，则连接
	if (cI.selectNodes("source")(0).text != "") {
		if(cI.selectNodes("source")(0).text == "mapred-default.xml"){
			maperedHTML += cI.selectNodes("name")(0).text;
			maperedHTML += cI.selectNodes("valve")(0).text;
		}else if(cI.selectNodes("source")(0).text == "yarn-default.xml"){
			yarnHTML += cI.selectNodes("name")(0).text;
			yarnHTML += cI.selectNodes("valve")(0).text;
		}
	}
	// 否则为空链接
	else {
		alert('什么都得不到！');
	}
	HTML += "这是HTML += maperedHTML;";
	HTML += maperedHTML;
	HTML += "这是HTML += yarnHTML;";
	HTML += yarnHTML;
	// 得到该节点的属性值<span
	/*HTML += "<div id='" + cI.getAttribute("id") + "' style='display:none'>\n";*/
	
	HTML += "</div>\n";
	return;
}